package cn.xiaobai.enums;

/**
 * 通用 sql 枚举
 *
 * @Author yangdaji
 * @Date 2024/3/24
 * @PackageName cn.xiaobai.enums
 * @ClassName InitSQL
 */
public enum InitSQL {

    /**
     * 创建数据库
     */
    INIT_DATABASE("CREATE DATABASE IF NOT EXISTS %s CHARACTER SET UTF8MB4 COLLATE UTF8MB4_0900_AI_CI;"),
    /**
     * 显示所有表名
     */
    SHOW_TABLES("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '%s';"),
    /**
     * 查询所有字段
     */
    SHOW_TABLE_COLUM("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='%s' AND TABLE_NAME='%s';");

    private String sql;

    InitSQL(String sql) {
        this.sql = sql;
    }

    public String getSql() {
        return sql;
    }
}
